<section id="eventos">
	<div class="container">
		<h1 class="entry-title">EVENTOS</h1>
		<div id="articles">
<?php 		wp_reset_query();
			$args = array(
            	'posts_per_page'  => 3,
            	'offset'          => 0,
            	'category_name'   => 'eventos',
            	'orderby'         => 'post_date',
            	'order'           => 'DESC',
            	'include'         => '',
            	'exclude'         => '',
            	'meta_key'        => '',
            	'meta_value'      => '',
            	'post_type'       => 'post',
            	'post_mime_type'  => '',
            	'post_parent'     => '',
            	'post_status'     => 'publish',
            	'suppress_filters' => true
            );
            query_posts($args);
			$i = 1;
            if ( have_posts() ) :
				while ( have_posts() ) : the_post();
                    if ($i==2) echo '<img src="'.get_bloginfo('template_url').'/images/separacao.png" />';
                    ?>
				    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                        <div class="entry-content">
                            <?php 
                            if ( has_category( 'produto') ){
                                $imagem = get_image('imagens');
                            }else{
                                $imagem = get_the_post_thumbnail();
                            }

                            $category = get_the_category();
                            $tipo = strtoupper($category[0]->cat_name);

                            if($imagem):
                                echo "<div class='img_container'>".$imagem."</div>";
                            endif;
                            ?>
                            <div class="title">
                                <?php if (is_search() && $tipo): ?>
                                    <b><?php echo $tipo; ?></b> - 
                                <?php endif; ?>
                                <a href="<?php the_permalink(); ?>">
                                    <?php the_title(); ?>
                                </a>
                            </div>

                <?php       if (has_excerpt()){ 
                                the_excerpt(); 
                            }else{ ?>
                <?                  $content = substr(get_the_content(),0,545);
                                $content = explode('\n',$content);
                                foreach($content as $cont){
                                    echo '<p><span>'.$cont.'</span></p>';
                                }
                                echo '...';
                            }
                ?>          <a class="leia" href="<?php the_permalink(); ?>">Leia [+]</a>
                        </div><!-- .entry-content -->
                    </article><!-- #post- -->
                <?php
                    if ($i==2) echo '<img src="'.get_bloginfo('template_url').'/images/separacao.png" />';
                    $i++;
				endwhile;
			endif;
?> 		<div class="clear"></div>
		</div><!-- articles -->
	</div><!-- container -->
</section><!-- eventos -->